<extend name="Public/base"/>
<block name="head">
	 <link href="__MOBILE__/css/list.css" rel="stylesheet">
	  <link href="__MOBILE__/css/article.css" rel="stylesheet">
</block>
<block name="body">
	 <include file="Public:banner" />
	 <div class="container">
	 	<div class="row index-menu">
	 		<div class="col-xs-3 user">
	 			<a href="{:U('CategoryGoods/index')}">
		 			<i class=" glyphicon glyphicon-equalizer col-xs-12"></i>
		 			<span class="col-xs-12">分类</span>
	 			</a>
	 		</div>
	 		<div class="col-xs-3 topic">
	 			<a href="{:U('Topic/index')}">
		 			<i class=" glyphicon glyphicon-piggy-bank col-xs-12"></i>
		 			<span class="col-xs-12">专题</span>
		 		</a>
	 		</div>
	 		<div class="col-xs-3 mall">
	 			<a href="{:U('PointsMall/index')}">
	 				<i class="glyphicon glyphicon-gift col-xs-12"></i>
	 				<span class="col-xs-12">积分</span>
	 			</a>
	 		</div>
	 		
	 		<div class="col-xs-3 sign-in">
	 			<a href="{:U('User/signIn')}">
	 			<i class="glyphicon glyphicon-pencil col-xs-12"></i>
	 			<span class="col-xs-12">签到</span>
	 			</a>
	 		</div>
	 	</div>
	 </div>
	  <if condition="$config['INDEX_CONTENT'] eq 'article'">
	 		<include file="Public:article_list" />
	 	<div class="container">
		 	<div class="row">
				<div class="col-sm-12 ">
					<button id="next" class="btn" p="2" total-page="{$total_page}">
						点击加载更多
					</button>
				</div>
			
	      </div>
	 	</div>
	 <elseif condition="$config['INDEX_CONTENT'] eq 'goods'"/>
	 	<div class="container">
		 	
		 	<notempty name="cate">
		 		<volist name="cate" id ="v">
		 			<div class="row cate">
		 				<h4>{$v.cate_name}<a href="{:U('Goods/cate',array('id'=>$v['cate_id']))}">更多&nbsp;>></a></h4>
		 				<include file="Public:index_goods_list" />
		 			</div>
		 		</volist>
		 	</notempty>
			 
		 </div>
	 </if>

</block>
<block name="script">
<script>
	 $(function(){   
		  $('#next').click(function(){
		  	LoadPage();  
		  }); 
	}); 
	function LoadPage(){
		var currentPage = $('#next').attr('p') ? $('#next').attr('p') : 1;
		$.get("{:U('Index/ajaxNews')}",{p:currentPage},function(result){
			if(result.errno==0){
				$('.article .list').append(result.content);
				$('#next').attr('p',result.p);
				if(result.p>=$('#next').attr('total-page')){
					$('#next').html('木有了，亲');
					$('#next').attr('disabled',true);
					$('#next').addClass('disabled');
				}
			}
			
		},'json');	
	}

	$(function(){
		$('.goods-list').find('li').each(function(){
			
			a = $('.goods-list').innerWidth()/2*1.55;
			b = $('.goods-list').innerWidth()/2*0.95;
			$(this).find('.goods-pic').each(function(){
				$(this).innerHeight(Math.round(b)-1);	
			});
			$(this).innerHeight(Math.round(a)-1);	
			
		});
		heightlight_bottom_nav("{:U('index')}"); 
	});
</script>	 
</block>
